package edu.odu.cs.sstore.dto;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotEmpty;

public class CourseDTO implements Serializable {

	private static final long serialVersionUID = 683875325306717134L;
	
	@NotNull(message="Course CRN cannot be blank.")
	private Long crn;
	
	@NotEmpty(message="Course name cannot be blank.")
	private String name;
	
	@NotEmpty(message="Course code cannot be blank.")
	private String code;
	
	private UserDTO faculty;
	private Set<UserDTO> students;
	private Set<DocumentDTO> documents;
	
	public CourseDTO() {
		this.crn = null;
		this.name = null;
		this.code = null;
		this.faculty = null;
		this.students = new HashSet<UserDTO>();
		this.documents = new HashSet<DocumentDTO>();
	}
	
	public CourseDTO(Long crn, String code, String name, UserDTO faculty, Set<UserDTO> students, Set<DocumentDTO> documents) {
		this.crn = crn;
		this.code = code;
		this.name = name;
		this.faculty = faculty;
		this.students = students;
		this.documents = documents;
	}

	public void setCrn(Long crn) {
		this.crn = crn;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public void setFaculty(UserDTO faculty) {
		this.faculty = faculty;
	}

	public void setStudents(Set<UserDTO> students) {
		this.students = students;
	}

	public void setDocuments(Set<DocumentDTO> documents) {
		this.documents = documents;
	}

	public Long getCrn() {
		return crn;
	}

	public String getName() {
		return name;
	}

	public String getCode() {
		return code;
	}

	public UserDTO getFaculty() {
		return faculty;
	}

	public Set<UserDTO> getStudents() {
		return students;
	}
	
	public Set<DocumentDTO> getDocuments() {
		return documents;
	}
}
